#include <iostream>
#include <string>
using namespace std;
class Person
{
public:
    Person(string n = "") : name(n)
    {
        cout << "Person CON" << endl;
    }

    void print() const
    {
        cout << "Name:  " << name << endl;
    }

protected:
    string name;
};

class Student : public virtual Person
{
public:
    Student(string n = "", string sid = "") : Person(n), SID(sid)
    {
        cout << "Student CON" << endl;
    }
    void print() const
    {
        Person::print();
        cout << "SID: " << SID << endl;
    }

protected:
    string SID;
};

class Teacher : public virtual Person
{
public:
    Teacher(string n = "", int s = 0) : Person(n), salary(s)
    {
        cout << "Teacher CON" << endl;
    }
    void print() const
    {
        Person::print();
        cout << "Salary: " << salary << endl;
    }

protected:
    int salary;
};

class SubsTeacher : public Teacher, public Student
{
public:
    SubsTeacher(string n = "", string sid = "", int s = 0) : Person(n),Student(n, sid), Teacher(n, s)
    {
        cout << "SubsTeacher CON" << endl;
    }
    void print2() const
    {
        Student::print();
        Teacher::print();
    }
    void print()const
    {
        cout << "Name:" << name << endl;
        cout << "SID: " << SID << endl;
        cout << "Salary: " << salary << endl;
    }
};

int main()
{
    SubsTeacher stobj1("Tom", "20171203025", 1500);
    stobj1.print();
    return 0;
}